package com.ruoyi.web.dto;

import com.ruoyi.framework.web.contants.AbnormalConstants;
import com.ruoyi.web.constant.RegexConstants;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * 通过手机号、密码登录DTO
 *
 * @since 2023/3/20 15:15
 */
@Data
public class AppUserLoginPasswordDTO {
    /**
     * 手机号
     */
    @NotEmpty(message = AbnormalConstants.MANDATORY_PARAM_EMPTY_OR_MALFORMED)
    @Pattern(regexp = RegexConstants.LOGIN_PHONE, message = AbnormalConstants.MANDATORY_PARAM_EMPTY_OR_MALFORMED)
    private String phone;

    /**
     * 密码
     */
    @NotEmpty(message = AbnormalConstants.MANDATORY_PARAM_EMPTY_OR_MALFORMED)
    @Pattern(regexp = RegexConstants.LOGIN_PASSWORD, message = AbnormalConstants.MANDATORY_PARAM_EMPTY_OR_MALFORMED)
    private String password;
}
